<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Gem::QueryUtils - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="Text.html">Gem::Text</a>
    <li><a class="include" href="LocalRemoteOptions.html">Gem::LocalRemoteOptions</a>
    <li><a class="include" href="VersionOption.html">Gem::VersionOption</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-add_query_options">#add_query_options</a>
    <li ><a href="#method-i-args">#args</a>
    <li ><a href="#method-i-check_installed_gems">#check_installed_gems</a>
    <li ><a href="#method-i-check_installed_gems-3F">#check_installed_gems?</a>
    <li ><a href="#method-i-display_header">#display_header</a>
    <li ><a href="#method-i-entry_details">#entry_details</a>
    <li ><a href="#method-i-entry_versions">#entry_versions</a>
    <li ><a href="#method-i-execute">#execute</a>
    <li ><a href="#method-i-gem_name-3F">#gem_name?</a>
    <li ><a href="#method-i-installed-3F">#installed?</a>
    <li ><a href="#method-i-make_entry">#make_entry</a>
    <li ><a href="#method-i-output_query_results">#output_query_results</a>
    <li ><a href="#method-i-output_versions">#output_versions</a>
    <li ><a href="#method-i-prerelease">#prerelease</a>
    <li ><a href="#method-i-show_gems">#show_gems</a>
    <li ><a href="#method-i-show_local_gems">#show_local_gems</a>
    <li ><a href="#method-i-show_prereleases-3F">#show_prereleases?</a>
    <li ><a href="#method-i-show_remote_gems">#show_remote_gems</a>
    <li ><a href="#method-i-spec_authors">#spec_authors</a>
    <li ><a href="#method-i-spec_homepage">#spec_homepage</a>
    <li ><a href="#method-i-spec_license">#spec_license</a>
    <li ><a href="#method-i-spec_loaded_from">#spec_loaded_from</a>
    <li ><a href="#method-i-spec_platforms">#spec_platforms</a>
    <li ><a href="#method-i-spec_summary">#spec_summary</a>
    <li ><a href="#method-i-specs_type">#specs_type</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Gem::QueryUtils">
    <h1 id="module-Gem::QueryUtils" class="module">
      module Gem::QueryUtils
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_query_options" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_query_options</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_query_options-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_query_options</span>
  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;-i&quot;</span>, <span class="ruby-string">&quot;--[no-]installed&quot;</span>,
             <span class="ruby-string">&quot;Check for installed gem&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:installed</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;-I&quot;</span>, <span class="ruby-string">&quot;Equivalent to --no-installed&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:installed</span>] = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_version_option</span> <span class="ruby-identifier">command</span>, <span class="ruby-string">&quot;for use with --installed&quot;</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;-d&quot;</span>, <span class="ruby-string">&quot;--[no-]details&quot;</span>,
             <span class="ruby-string">&quot;Display detailed information of gem(s)&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:details</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;--[no-]versions&quot;</span>,
             <span class="ruby-string">&quot;Display only gem names&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:versions</span>] = <span class="ruby-identifier">value</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:details</span>] = <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;-a&quot;</span>, <span class="ruby-string">&quot;--all&quot;</span>,
             <span class="ruby-string">&quot;Display all gem versions&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:all</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;-e&quot;</span>, <span class="ruby-string">&quot;--exact&quot;</span>,
             <span class="ruby-string">&quot;Name of gem(s) to query on matches the&quot;</span>,
             <span class="ruby-string">&quot;provided STRING&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:exact</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_option</span>(<span class="ruby-string">&quot;--[no-]prerelease&quot;</span>,
             <span class="ruby-string">&quot;Display prerelease versions&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">add_local_remote_options</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-execute" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">execute</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="execute-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">execute</span>
  <span class="ruby-identifier">gem_names</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
    [<span class="ruby-identifier">options</span>[<span class="ruby-value">:name</span>]]
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-value">:exact</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> <span class="ruby-regexp">/\A#{Regexp.escape(arg)}\Z/</span> } <span class="ruby-operator">:</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> <span class="ruby-regexp">/#{arg}/i</span> }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">terminate_interaction</span>(<span class="ruby-identifier">check_installed_gems</span>(<span class="ruby-identifier">gem_names</span>)) <span class="ruby-keyword">if</span> <span class="ruby-identifier">check_installed_gems?</span>

  <span class="ruby-identifier">gem_names</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">show_gems</span>(<span class="ruby-identifier">n</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-args" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">args</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="args-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">args</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:args</span>].<span class="ruby-identifier">to_a</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_installed_gems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_installed_gems</span><span
                                class="method-args">(gem_names)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_installed_gems-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 73</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_installed_gems</span>(<span class="ruby-identifier">gem_names</span>)
  <span class="ruby-identifier">exit_code</span> = <span class="ruby-value">0</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">gem_name?</span>
    <span class="ruby-identifier">alert_error</span> <span class="ruby-string">&quot;You must specify a gem name&quot;</span>
    <span class="ruby-identifier">exit_code</span> = <span class="ruby-value">4</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">gem_names</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">alert_error</span> <span class="ruby-string">&quot;You must specify only ONE gem!&quot;</span>
    <span class="ruby-identifier">exit_code</span> = <span class="ruby-value">4</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">installed</span> = <span class="ruby-identifier">installed?</span>(<span class="ruby-identifier">gem_names</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:version</span>])
    <span class="ruby-identifier">installed</span> = <span class="ruby-operator">!</span><span class="ruby-identifier">installed</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:installed</span>]

    <span class="ruby-identifier">say</span>(<span class="ruby-identifier">installed</span>)
    <span class="ruby-identifier">exit_code</span> = <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">installed</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">exit_code</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_installed_gems-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_installed_gems?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_installed_gems-3F-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 93</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_installed_gems?</span>
  <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value">:installed</span>].<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-display_header" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">display_header</span><span
                                class="method-args">(type)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="display_header-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">display_header</span>(<span class="ruby-identifier">type</span>)
  <span class="ruby-keyword">if</span> (<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">outs</span>.<span class="ruby-identifier">tty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">verbose</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">both?</span>
    <span class="ruby-identifier">say</span>
    <span class="ruby-identifier">say</span> <span class="ruby-node">&quot;*** #{type} GEMS ***&quot;</span>
    <span class="ruby-identifier">say</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-entry_details" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">entry_details</span><span
                                class="method-args">(entry, detail_tuple, specs, platforms)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="entry_details-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 223</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entry_details</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">detail_tuple</span>, <span class="ruby-identifier">specs</span>, <span class="ruby-identifier">platforms</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:details</span>]

  <span class="ruby-identifier">name_tuple</span>, <span class="ruby-identifier">spec</span> = <span class="ruby-identifier">detail_tuple</span>

  <span class="ruby-identifier">spec</span> = <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">fetch_spec</span>(<span class="ruby-identifier">name_tuple</span>)<span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:fetch_spec</span>)

  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>

  <span class="ruby-identifier">spec_platforms</span>   <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">platforms</span>
  <span class="ruby-identifier">spec_authors</span>     <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>
  <span class="ruby-identifier">spec_homepage</span>    <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>
  <span class="ruby-identifier">spec_license</span>     <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>
  <span class="ruby-identifier">spec_loaded_from</span> <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>, <span class="ruby-identifier">specs</span>
  <span class="ruby-identifier">spec_summary</span>     <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-entry_versions" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">entry_versions</span><span
                                class="method-args">(entry, name_tuples, platforms, specs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="entry_versions-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 240</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entry_versions</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">name_tuples</span>, <span class="ruby-identifier">platforms</span>, <span class="ruby-identifier">specs</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:versions</span>]

  <span class="ruby-identifier">list</span> =
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:details</span>]
      <span class="ruby-identifier">name_tuples</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:version</span>).<span class="ruby-identifier">uniq</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">version</span>, <span class="ruby-identifier">pls</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">out</span> = <span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_s</span>

        <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:domain</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:local</span>
          <span class="ruby-identifier">default</span> = <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
            <span class="ruby-operator">!</span><span class="ruby-identifier">s</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Source</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">default_gem?</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">out</span> = <span class="ruby-node">&quot;default: #{out}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">default</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">if</span> <span class="ruby-identifier">pls</span> <span class="ruby-operator">!=</span> [<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>]
          <span class="ruby-identifier">platform_list</span> = [<span class="ruby-identifier">pls</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>), <span class="ruby-operator">*</span><span class="ruby-identifier">pls</span>.<span class="ruby-identifier">sort</span>].<span class="ruby-identifier">compact</span>
          <span class="ruby-identifier">out</span> = <span class="ruby-identifier">platform_list</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">out</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; &quot;</span>)
        <span class="ruby-keyword">end</span>

        <span class="ruby-identifier">out</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; (#{list.join &quot;, &quot;})&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_name?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_name-3F-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 97</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_name?</span>
  <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value">:name</span>].<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-installed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">installed?</span><span
                                class="method-args">(name, req = Gem::Requirement.default)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Check if gem <code>name</code> version <code>version</code> is installed.</p>

                              <div class="method-source-code" id="installed-3F-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 177</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">installed?</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">req</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>)
  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">req</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-make_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">make_entry</span><span
                                class="method-args">(entry_tuples, platforms)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="make_entry-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 269</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_entry</span>(<span class="ruby-identifier">entry_tuples</span>, <span class="ruby-identifier">platforms</span>)
  <span class="ruby-identifier">detail_tuple</span> = <span class="ruby-identifier">entry_tuples</span>.<span class="ruby-identifier">first</span>

  <span class="ruby-identifier">name_tuples</span>, <span class="ruby-identifier">specs</span> = <span class="ruby-identifier">entry_tuples</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">partition</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">NameTuple</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">item</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">entry</span> = [<span class="ruby-identifier">name_tuples</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">name</span>]

  <span class="ruby-identifier">entry_versions</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">name_tuples</span>, <span class="ruby-identifier">platforms</span>, <span class="ruby-identifier">specs</span>)
  <span class="ruby-identifier">entry_details</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">detail_tuple</span>, <span class="ruby-identifier">specs</span>, <span class="ruby-identifier">platforms</span>)

  <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">join</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-output_query_results" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">output_query_results</span><span
                                class="method-args">(spec_tuples)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="output_query_results-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 181</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">output_query_results</span>(<span class="ruby-identifier">spec_tuples</span>)
  <span class="ruby-identifier">output</span> = []
  <span class="ruby-identifier">versions</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">name</span>] = [] }

  <span class="ruby-identifier">spec_tuples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec_tuple</span>, <span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">versions</span>[<span class="ruby-identifier">spec_tuple</span>.<span class="ruby-identifier">name</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">spec_tuple</span>, <span class="ruby-identifier">source</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">versions</span> = <span class="ruby-identifier">versions</span>.<span class="ruby-identifier">sort_by</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">n</span>,<span class="ruby-identifier">_</span>),<span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">n</span>.<span class="ruby-identifier">downcase</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">output_versions</span> <span class="ruby-identifier">output</span>, <span class="ruby-identifier">versions</span>

  <span class="ruby-identifier">say</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:details</span>] <span class="ruby-operator">?</span> <span class="ruby-string">&quot;\n\n&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;\n&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-output_versions" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">output_versions</span><span
                                class="method-args">(output, versions)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="output_versions-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 198</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">output_versions</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">versions</span>)
  <span class="ruby-identifier">versions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_gem_name</span>, <span class="ruby-identifier">matching_tuples</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">matching_tuples</span> = <span class="ruby-identifier">matching_tuples</span>.<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>,<span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">version</span> }.<span class="ruby-identifier">reverse</span>

    <span class="ruby-identifier">platforms</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">version</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">version</span>] = [] }

    <span class="ruby-identifier">matching_tuples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">platforms</span>[<span class="ruby-identifier">n</span>.<span class="ruby-identifier">version</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">platform</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">platform</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">seen</span> = {}

    <span class="ruby-identifier">matching_tuples</span>.<span class="ruby-identifier">delete_if</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>,<span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">seen</span>[<span class="ruby-identifier">n</span>.<span class="ruby-identifier">version</span>]
        <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">seen</span>[<span class="ruby-identifier">n</span>.<span class="ruby-identifier">version</span>] = <span class="ruby-keyword">true</span>
        <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">clean_text</span>(<span class="ruby-identifier">make_entry</span>(<span class="ruby-identifier">matching_tuples</span>, <span class="ruby-identifier">platforms</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prerelease" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prerelease</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="prerelease-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 101</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prerelease</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_gems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_gems</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Guts of original execute</p>

                              <div class="method-source-code" id="show_gems-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 122</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_gems</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">show_local_gems</span>(<span class="ruby-identifier">name</span>)  <span class="ruby-keyword">if</span> <span class="ruby-identifier">local?</span>
  <span class="ruby-identifier">show_remote_gems</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">remote?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_local_gems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_local_gems</span><span
                                class="method-args">(name, req = Gem::Requirement.default)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_local_gems-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 127</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_local_gems</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">req</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>)
  <span class="ruby-identifier">display_header</span>(<span class="ruby-string">&quot;LOCAL&quot;</span>)

  <span class="ruby-identifier">specs</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">name_matches</span> = <span class="ruby-identifier">name</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">version_matches</span> = <span class="ruby-identifier">show_prereleases?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span>.<span class="ruby-identifier">prerelease?</span>

    <span class="ruby-identifier">name_matches</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">version_matches</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">spec_tuples</span> = <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
    [<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name_tuple</span>, <span class="ruby-identifier">spec</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">output_query_results</span>(<span class="ruby-identifier">spec_tuples</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_prereleases-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_prereleases?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_prereleases-3F-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 105</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_prereleases?</span>
  <span class="ruby-identifier">prerelease</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prerelease</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_remote_gems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_remote_gems</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_remote_gems-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 144</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_remote_gems</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">display_header</span>(<span class="ruby-string">&quot;REMOTE&quot;</span>)

  <span class="ruby-identifier">fetcher</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">SpecFetcher</span>.<span class="ruby-identifier">fetcher</span>

  <span class="ruby-identifier">spec_tuples</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">fetcher</span>.<span class="ruby-identifier">detect</span>(<span class="ruby-identifier">specs_type</span>) { <span class="ruby-keyword">true</span> }
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">fetcher</span>.<span class="ruby-identifier">detect</span>(<span class="ruby-identifier">specs_type</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name_tuple</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">name</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">name_tuple</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:version</span>].<span class="ruby-identifier">satisfied_by?</span>(<span class="ruby-identifier">name_tuple</span>.<span class="ruby-identifier">version</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">output_query_results</span>(<span class="ruby-identifier">spec_tuples</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_authors" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_authors</span><span
                                class="method-args">(entry, spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_authors-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 284</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_authors</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>)
  <span class="ruby-identifier">authors</span> = <span class="ruby-node">&quot;Author#{spec.authors.length &gt; 1 ? &quot;s&quot; : &quot;&quot;}: &quot;</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">authors</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">authors</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">format_text</span>(<span class="ruby-identifier">authors</span>, <span class="ruby-value">68</span>, <span class="ruby-value">4</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_homepage" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_homepage</span><span
                                class="method-args">(entry, spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_homepage-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 290</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_homepage</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">homepage</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">homepage</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">format_text</span>(<span class="ruby-node">&quot;Homepage: #{spec.homepage}&quot;</span>, <span class="ruby-value">68</span>, <span class="ruby-value">4</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_license" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_license</span><span
                                class="method-args">(entry, spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_license-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 296</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_license</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">license</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">license</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">licenses</span> = <span class="ruby-node">&quot;License#{spec.licenses.length &gt; 1 ? &quot;s&quot; : &quot;&quot;}: &quot;</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">licenses</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">licenses</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">format_text</span>(<span class="ruby-identifier">licenses</span>, <span class="ruby-value">68</span>, <span class="ruby-value">4</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_loaded_from" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_loaded_from</span><span
                                class="method-args">(entry, spec, specs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_loaded_from-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 304</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_loaded_from</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>, <span class="ruby-identifier">specs</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">loaded_from</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">default</span> = <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">default_gem?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot; (default)&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;    Installed at#{default}: #{spec.base_dir}&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">label</span> = <span class="ruby-string">&quot;Installed at&quot;</span>
    <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">version</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-identifier">version</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;, default&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">default_gem?</span>
      <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;    #{label} (#{version}): #{s.base_dir}&quot;</span>
      <span class="ruby-identifier">label</span> = <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">label</span>.<span class="ruby-identifier">length</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_platforms" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_platforms</span><span
                                class="method-args">(entry, platforms)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_platforms-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 321</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_platforms</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">platforms</span>)
  <span class="ruby-identifier">non_ruby</span> = <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">pls</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">pls</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">pl</span><span class="ruby-operator">|</span> <span class="ruby-identifier">pl</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span> }
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">non_ruby</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">title</span> = <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;Platform&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;Platforms&quot;</span>
    <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;    #{title}: #{platforms.values.sort.join(&quot;, &quot;)}\n&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;    Platforms:\n&quot;</span>

    <span class="ruby-identifier">sorted_platforms</span> = <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">sort</span>

    <span class="ruby-identifier">sorted_platforms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">version</span>, <span class="ruby-identifier">pls</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">label</span> = <span class="ruby-node">&quot;        #{version}: &quot;</span>
      <span class="ruby-identifier">data</span> = <span class="ruby-identifier">format_text</span> <span class="ruby-identifier">pls</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>), <span class="ruby-value">68</span>, <span class="ruby-identifier">label</span>.<span class="ruby-identifier">length</span>
      <span class="ruby-identifier">data</span>[<span class="ruby-value">0</span>, <span class="ruby-identifier">label</span>.<span class="ruby-identifier">length</span>] = <span class="ruby-identifier">label</span>
      <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_summary" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_summary</span><span
                                class="method-args">(entry, spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_summary-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 345</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_summary</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">spec</span>)
  <span class="ruby-identifier">summary</span> = <span class="ruby-identifier">truncate_text</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">summary</span>, <span class="ruby-node">&quot;the summary for #{spec.full_name}&quot;</span>)
  <span class="ruby-identifier">entry</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">format_text</span>(<span class="ruby-identifier">summary</span>, <span class="ruby-value">68</span>, <span class="ruby-value">4</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_type</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs_type-source">
            <pre><span class="ruby-comment"># File rubygems/query_utils.rb, line 160</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_type</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:all</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:version</span>].<span class="ruby-identifier">specific?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]
      <span class="ruby-value">:complete</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-value">:released</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]
    <span class="ruby-value">:prerelease</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-value">:latest</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

